<template>
  <div>
    <el-form ref="form" :model="form" label-position="top">
      <el-form-item label="1.请勾选您离职的主要原因（多选）">
        <el-checkbox-group v-model="form.reason" :disabled="isinput">
          <el-checkbox
            v-for="item in reasontag"
            :label="item.label"
            :key="item.label"
            >{{ item.label }}</el-checkbox
          >
        </el-checkbox-group>
      </el-form-item>

      <el-form-item label="2.您认为公司在一下哪些方面需要加以改善（多选）">
        <el-checkbox-group v-model="form.improve" :disabled="isinput">
          <el-checkbox
            v-for="item in improvetag"
            :label="item.label"
            :key="item.label"
            >{{ item.label }}</el-checkbox
          >
        </el-checkbox-group>
      </el-form-item>

      <el-form-item label="3.如果有机会，您是否愿意重新加入公司?">
        <el-radio-group v-model="form.isreserve" :disabled="isinput">
          <el-radio label="愿意" value="0"></el-radio>
          <el-radio label="不愿意" value="1"></el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item label="4.是什么促使您当初加入本公司？">
        <el-input
          type="textarea"
          v-model="form.q1"
          :disabled="isinput"
        ></el-input>
      </el-form-item>

      <el-form-item
        label="5.在您做出离职决定时，您发现公司在哪些方面与您的想象和期望差距较大？"
      >
        <el-input
          type="textarea"
          v-model="form.q2"
          :disabled="isinput"
        ></el-input>
      </el-form-item>

      <el-form-item label="6.您如何评价您的直属上级？">
        <el-input
          type="textarea"
          v-model="form.q3"
          :disabled="isinput"
        ></el-input>
      </el-form-item>

      <el-form-item label="7.您比较喜欢或不喜欢公司的哪些方面？">
        <el-input
          type="textarea"
          v-model="form.q4"
          :disabled="isinput"
        ></el-input>
      </el-form-item>

      <el-form-item
        label="8.您对公司的管理模式、工作氛围、企业文化有何建议和意见？"
      >
        <el-input
          type="textarea"
          v-model="form.q5"
          :disabled="isinput"
        ></el-input>
      </el-form-item>

      <el-form-item label="9.您认为公司应该采取哪些措施来更有效地留住人才？">
        <el-input
          type="textarea"
          v-model="form.q6"
          :disabled="isinput"
        ></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: ["form", "isinput"],

  created() {
    this.getreasontag();
    this.getimprovetag();
  },

  data() {
    return {
      reasontag: [],
      improvetag: [],
    };
  },

  methods: {
    async getreasontag() {
      let id = 0;
      let tag = await this.$axios.get(`api/member/getusertag?type=` + id);
      this.reasontag = tag.data;
    },

    async getimprovetag() {
      let id = 1;
      let tag = await this.$axios.get(`api/member/getusertag?type=` + id);
      this.improvetag = tag.data;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>